import { default as request, cloud } from '@/framework/utils/request'
export default ({
  fetchPage(params) {
    return request({
      url: cloud.dqbasic + '/partyMemberDuty/page',
      method: 'get',
      params
    })
  },

  member(params) {
    return request({
      url: cloud.dqbasic + '/partyMemberDuty/member',
      method: 'get',
      params
    })
  },

  add(data) {
    return request({
      url: cloud.dqbasic + '/partyMemberDuty/add',
      method: 'post',
      data
    })
  },
  delete(ids) {
    return request({
      url: cloud.dqbasic + '/partyMemberDuty/delete',
      method: 'post',
      data: {
        id: ids
      }
    })
  },

  excelExport(data) {
    return request({
      url: cloud.dqbasic + '/partyMemberDuty/excelExport',
      method: 'post',
      responseType: 'blob',
      data
    })
  },
  detail(id) {
    return request({
      url: cloud.dqbasic + '/partyMemberDuty/detail',
      method: 'get',
      params: {
        id
      }
    })
  },

  changSort(id, direction) {
    return request({
      url: cloud.dqbasic + '/partyMemberDuty/changSort',
      method: 'post',
      data: {
        id,
        direction
      }
    })
  }
})
